<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<script type="text/javascript">
<!--
$(document).ready(function(){
	checkboxPlugin.init("alertList");
});
//-->
</script>

<form id="pagerForm" method="post" action="${ctx }/crm/alert.action">
	<input type="hidden" name="status" value="${param.status}">
	<input type="hidden" name="keywords" value="${param.keywords}" />
	<input type="hidden" name="pageNum"  value="${page.pageNo}" />
	<input type="hidden" name="numPerPage" id="numPerPage" value="${page.pageSize}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	<input type="hidden" name="selectedId" id="selectedId" value="" />
	<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}"/>
	<input type="hidden" name="page.orderBy" id="orderBy" value="${page.orderBy}"/>
	<input type="hidden" name="page.order" id="order" value="${page.order}"/>
	<input type="hidden" name="page.pageSize" id="pageSize" value="${page.pageSize}"/>
</form>

<div class="page">
	<div class="pageHeader">
		<form id="alertList" onsubmit="return navTabSearch(this);" action="${ctx }/crm/alert.action" method="post">
		<input type="hidden" value="${param['smsalert']}" name="smsalert" id="smsalert">
		<input type="hidden" value="${param['sysalert']}" name="sysalert" id="sysalert">
		<input type="hidden" value="${param['loginalert']}" name="loginalert"  id="loginalert">
		<div class="searchBar">
			<ul class="searchContent">
				<li>
					<label>主题：</label>
					<input type="text" name="topic" value="${param['topic']}"/>
				</li>
				<li style="width:400px;">
					<label>提醒方式：</label>
					<input type="checkbox" value="1/" id="smsalert_check" />短信定时提醒 
					<input type="checkbox" value="1/" id="sysalert_check" />系统定时提醒 
					<input type="checkbox" value="1/" id="loginalert_check" />登录提醒  
				</li>
				<li>
					<label>创建者：</label>
					<input type="text" id="username" name="username" value="${param['username']}" />
				</li>
			</ul>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit"> 检 索 </button></div></div></li>
				</ul>
			</div>
		</div>
		</form>
	</div>
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<li><a class="add" href="${ctx }/crm/alert!input.action" target="navTab" rel="alertAdd"><span>创建日程</span></a></li>
				<li><a  class="delete" target="navTabTodo"  href="${ctx}/crm/alert!delete.action?id={alertId}" title="确定要删除吗?"><span>删除</span></a></li>
				<li><a  class="edit" href="${ctx}/crm/alert!input.action?id={alertId}"  target="navTab" ><span>编辑日程</span></a></li>
				<li class="line">line</li>
			</ul>
		</div>
		<table class="table" layouth="142">
			<thead>
				<tr>
				<th>主题</th>
				<th>摘要</th>
				<th>提示方式</th>
				<th>类型</th>
				<th>提示时间</th>
				<th>状态</th>
				<th>更新时间</th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="page.result">
					<tr target="alertId" rel="${id}">
						<td>${topic}</td>
						<td>
						<s:if test="summary!=null&&summary.length()>20" >
						<s:property value="summary.substring(0,20)+'…'"/>
						</s:if>
						<s:else>
							<s:property value="summary"/>
						</s:else>
						</td>
						<td>
						<s:if test="smsalert==1">短信提示 </s:if>
						<s:if test="sysalert==1">系统提示 </s:if>
						<s:if test="loginalert==1">登录提示</s:if>
						</td>
						<td><s:if test="self==2">公司提醒</s:if><s:else>个人提醒</s:else></td>
						<td><s:date name="alerttime" format="yyyy-MM-dd HH:mm"/></td>
						<td><s:if test="published==1">已发出</s:if><s:else>未发出</s:else></td>
						<td><s:date name="updatedate" format="yyyy-MM-dd HH:mm"/></td>
					</tr>
		</s:iterator>	
			</tbody>
		</table>
		<div class="panelBar">
			<div class="pages">
				<span>显示</span>
				<select name="numPerPage" id="showNumPerPage" onchange="$('#pageSize').val($(this).val());navTabPageBreak({numPerPage:this.value})">
					<option value="14">14</option>
					<option value="20">20</option>
					<option value="50">50</option>
					<option value="100">100</option>
				</select>
				<span>条，共${page.totalCount}条</span>
			</div>
			
			<div class="pagination" targetType="navTab" totalCount="${page.totalCount}" numPerPage="${page.pageSize}" pageNumShown="10" currentPage="${page.pageNo}"></div>

		</div>
	</div>
</div>